import { createRouter, createWebHashHistory } from "vue-router";

const routes = [
  {
    path: '/',
    name: 'login',
    redirect:'json_format',
    component: () => import(/*webpackChunkName:'index'*/'@/page/index.vue'),
    children: [
      {
        path: 'entity_generator',
        name: 'entity_generator',
        component: () => import(/*webpackChunkName:'EntityGenerator'*/'@/page/tools/entity_generator.vue'),
      },
      {
        path: 'json_format',
        name: 'json_format',
        component: () => import(/*webpackChunkName:'EntityGenerator'*/'@/page/tools/json_format.vue'),
      }
    ]
  },
  {
    path: '/',
    name: 'EntityGenerator',
    component: () => import(/*webpackChunkName:'EntityGenerator'*/'@/page/tools/entity_generator.vue')
  }
];


// . 创建路由实例并传递 `routes` 配置
// 你可以在这里输入更多的配置，但我们在这里
// 暂时保持简单
const router = createRouter({
  // . 内部提供了 history 模式的实现。为了简单起见，我们在这里使用 hash 模式。
  history: createWebHashHistory(),
  routes, // `routes: routes` 的缩写
})

export default router;

